Repository navigation
Defer output JAR creation until the first entry is written - #27662
Open
anatoliykmetyuk wants to merge 3 commits into
Open
anatoliykmetyuk wants to merge 3 commits into
anatoliykmetyuk wants to merge 3 commits into
Conversation
anatoliykmetyuk
marked this pull request as ready for review
November 27, 2026 06:56
Contributor
|
How urgent is this? I wanted to address it as part of #26512, but happy to merge this in the meantime if it's blocking someone -- that PR has been delayed for a while because removing our scala2 dependency from the stdlib is taking me longer than I wanted. |
Contributor
Author
|
It's not blocking anyone as far as I know, I've also submitted a fix on the sbt side that will resolve it as well for the original reporter. So feel free to defer it to that integrated PR if you think it's better! |
Contributor
|
OK, I'll leave this open so I can use the tests and try to get to it next week. Sorry for not planning this better. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #27587
Related to sbt/sbt#10063
Problem: options such as
-dor-Ypickle-writecreate the destination jars immediately after being processed by the compiler at the beginning of the compilation pipeline. In the scenario of e.g. presentation compiler, the writes to the destination may never happen, yet, the destination will be recreated as an empty jar. Systems that rely on this jar may therefore end up with an empty jar and error.Solution: defer creation of mentioned jars to the time when the first write actually happens. Introduce the respective internal API,
JarDestinationandOutputtypes to model such lazy jar destinations.Have you relied on LLM-based tools in this contribution?
Yes, and I checked the output by manual review and testing against mentioned issue reproductions.
How was the solution tested?
New automated regression test:
SettingsTests.outputJarsAreWrittenOnFirstEntrycovers both flags, including parser-only runs, interactive compiler startup, and replacement of stale entries on a subsequent compile.